<template>
    <van-tabbar :route="true" v-model="active" active-color="#ee0a24">
        <van-tabbar-item to="/home" name="home" icon="home-o">首页</van-tabbar-item>
        <van-tabbar-item to="/cate" name="cate" icon="apps-o">分类</van-tabbar-item>
        <van-tabbar-item to="/cart" name="cart" icon="cart-o"
            :badge="$userInfo.cartList.length !== 0 ? ($userInfo.cartList.length <= 99 ? $userInfo.cartList.length : '99+') : ''">购物车</van-tabbar-item>
        <van-tabbar-item to="/self" name="self" icon="manager-o" :dot="!$userInfo.is_login">{{ $userInfo.is_login ? '我的' :
            '未登录' }}</van-tabbar-item>
    </van-tabbar>
</template>



<script name="sdyFooter" setup lang="ts">
import { ref, onMounted } from 'vue'
import useUserStore from '../store/user'

const $userInfo = useUserStore() as any
const active = ref<string>('home')
onMounted(() => {
    $userInfo.fn()
})

</script>